home *** CD-ROM | disk | FTP | other *** search
- ;
- ; bdos.mac by F. A. Scacchitti 9 - 18 - 84
- ;
- ; This assembly routine allows CPM calls from Small C.
- ;
- ; bdos(function,data) or cpm(function,data)
- ;
- ; NOTE - This function only returns what the bdos call
- ; placed in the accumulator
- ;
- BDOS::
- ;
- CPM::
- ;
- POP H ; Pop rtn address
- POP D ; Pop input parameter in DE register pair
- POP B ; Pop function code into C register
- PUSH B ; Restore stack
- PUSH D
- PUSH H
- CALL 5
- MOV L,A ; Sign extend A into HL register pair
- RLC
- SBB A
- MOV H,A
- ;
- RET
- ;
- END
-